import request from '@/router/axios';
// 获取责任部门
export const getDepts = (params) => {
  return request({
    url: '/api/hg-public/prodplanlist/getDepts',
    method: 'get',
    params: {
      ...params
    }
  })
}

// 获取责任人
export const getPersons = (params) => {
  return request({
    url: '/api/hg-public/prodplanlist/getPersons',
    method: 'get',
    params: {
      ...params
    }
  })
}

// 获取某项目下 未建计划的产品
export const getProducts = (params) => {
  return request({
    url: '/api/hg-public/prodplanlist/getProducts',
    method: 'get',
    params: {
      ...params
    }
  })
}

//根据项目和产品获取阶段任务
export const getStages = (params) => {
  return request({
    url: '/api/hg-public/prodplanlist/getPhasesTasks',
    method: 'get',
    params: {
      ...params
    }
  })
}
//开发计划列表
export const getDevplanList = (current, size, params) => {
  return request({
    url: '/api/hg-public/prodplanlist/page',
    method: 'get',
    params: {
      current,
      size,
      ...params
    }
  })
}
//新增开发计划
export const addDevplan = (row) => {
  return request({
    url: '/api/hg-public/prodplanlist/save',
    method: 'post',
    data: row
  })
}

//删除开发计划
export const removeDevplan = (ids) => {
  return request({
    url: '/api/hg-public/prodplanlist/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新开发计划
export const updateDevplan = (row) => {
  return request({
    url: '/api/hg-public/prodplanlist/update',
    method: 'post',
    data: row
  })
}
//获取开发计划详情
export const getDevplan = (id) => {
  return request({
    url: '/api/hg-public/prodplanlist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
//查询开发计划进度图数据
export const getProcessData = (params) => {
  return request({
    url: '/api/hg-public/prodplanlist/getProcessData',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//判断人员是否能变更
export const getPerChange = (params) => {
  return request({
    url: '/api/hg-public/prodplanlist/perChange',
    method: 'post',
    params: {
      ...params,
    }
  })
}